# -*- coding:utf-8 -*-
# @FileName  :ent_alertpage.py
# @Time      :2020/12/23 15:11
# @Author    :Zhoujirong
# @Desc      :
from common.http_request import Request
from biz.support.urls import ServerUrl

class EntAlertPageRequest:
    @classmethod
    def get_page(cls,curPage,
                    maxSize,
                    search_EQ_userName,
                    search_EQ_userStatus,
                    search_EQ_alertStatus,
                    search_EQ_aleratReason,
                    search_EQ_orgCode,
                    search_GTE_LTE_alertDate_DATE_RANGE,cookie):

        data = {
            'curPage':curPage,
            'maxSize':maxSize,
            'search_EQ_userName':search_EQ_userName,
            'search_EQ_userStatus':search_EQ_userStatus,
            'search_EQ_alertStatus':search_EQ_alertStatus,
            'search_EQ_aleratReason':search_EQ_aleratReason,
            'search_EQ_orgCode':search_EQ_orgCode,
            'search_GTE_LTE_alertDate_DATE_RANGE':search_GTE_LTE_alertDate_DATE_RANGE
        }
        req = Request(ServerUrl.ent_alert_getpage_url,params=data,headers=cookie)
        return req.get()

    @classmethod
    def list(cls,cookie):
        '''预警信息列表'''
        req = Request(ServerUrl.ent_alert_list_url,headers=cookie)
        return req.get()

    @classmethod
    def detail(cls,id,cookie):
        '''跳转详情页'''
        params = {
            'id':id
        }
        req = Request(ServerUrl.ent_alert_detail_url,params=params,headers=cookie)
        return req.get()

    @classmethod
    def findbyid(cls,id,cookie):
        '''详情'''
        data = {
            'id':id
        }
        req = Request(ServerUrl.ent_alert_findbyid_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def relievereason(cls, id, userStatus, cookie):
        '''核实原因页面'''
        params = {
            'id': id,
            'userStatus': userStatus
        }
        req = Request(ServerUrl.ent_alert_relievereason_url, params=params, headers=cookie)
        return req.get()

    @classmethod
    def relieve(cls, id, removeAlertReason, cookie):
        '''核实'''
        params = {
            'id': id,
            'removeAlertReason': removeAlertReason
        }
        req = Request(ServerUrl.ent_alert_relieve_url, params=params, headers=cookie)
        return req.post()

    @classmethod
    def addlock(cls,id,cookie):
        params = {
            'id':id
        }
        req = Request(ServerUrl.ent_alert_addlock_url,params=params,headers=cookie)
        return req.post()


    @classmethod
    def unlock(cls, id, cookie):
        params = {
            'id': id
        }
        req = Request(ServerUrl.ent_alert_unlock_url, params=params, headers=cookie)
        return req.post()

    @classmethod
    def exportload(cls,
        search_EQ_userName,
        search_EQ_userStatus,
        search_EQ_alertStatus,
        search_EQ_orgCode,
        search_EQ_aleratReason,
        search_GTE_LTE_alertDate_DATE_RANGE,ids,cookie):
        data = {
            'search_EQ_userName':search_EQ_userName,
            'search_EQ_userStatus':search_EQ_userStatus,
            'search_EQ_alertStatus':search_EQ_alertStatus,
            'search_EQ_aleratReason':search_EQ_aleratReason,
            'search_EQ_orgCode':search_EQ_orgCode,
            'search_GTE_LTE_alertDate_DATE_RANGE':search_GTE_LTE_alertDate_DATE_RANGE,
            'ids':ids,
        }
        req = Request(ServerUrl.ent_alert_exportload_url,params=data,headers=cookie)
        return req.get_download()





if __name__ == "__main__":
    pass